package com.whut.monitor.model;

import javax.persistence.*;
import java.util.Date;

/**
 * @author Sandeepin
 * 通道实体-对应数据库表
 */
@Entity
@Table(name = "t_channel")
public class ChannelEntity {
	// 通道ID
	private Integer channelId;
	private EquipmentEntity equipmentEntity;
	// 通道编号
	private String channelNum;
	private SensorEntity sensorEntity;
	// 通道名称
	private String channelName;
	// 通道位置类型，0：主轴；1：导轨；2：立柱
	private Integer positionType;
	// 通道位置编号
	private Integer positionNum;
	// 创建时间
	private Date createTime;
	// 备注
	private String descrip;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Integer getId() {
		return channelId;
	}
	public void setId(Integer id) {
		this.channelId = id;
	}

	@ManyToOne
	@JoinColumn(name = "equipment_id")
	public EquipmentEntity getEquipmentEntity() {
		return equipmentEntity;
	}
	public void setEquipmentEntity(EquipmentEntity equipmentEntity) {
		this.equipmentEntity = equipmentEntity;
	}

	@Column(name = "channel_num")
	public String getChannelNum() {
		return channelNum;
	}
	public void setChannelNum(String channelNum) {
		this.channelNum = channelNum;
	}

	@ManyToOne
	@JoinColumn(name = "sensor_id")
	public SensorEntity getSensorEntity() {
		return sensorEntity;
	}
	public void setSensorEntity(SensorEntity sensorEntity) {
		this.sensorEntity = sensorEntity;
	}

	@Column(name = "channel_name")
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	@Column(name = "position_type")
	public Integer getPositionType() {
		return positionType;
	}
	public void setPositionType(Integer positionType) {
		this.positionType = positionType;
	}

	@Column(name = "position_num")
	public Integer getPositionNum() {
		return positionNum;
	}
	public void setPositionNum(Integer positionNum) {
		this.positionNum = positionNum;
	}

	@Column(name = "createtime")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "descrip")
	public String getDescrip() {
		return descrip;
	}
	public void setDescrip(String descrip) {
		this.descrip = descrip;
	}

}
